﻿@using INNOVACALL.Framework.Common
@using InnovaApp.Layers.ResourcesLayer.Properties
@{
    string StyleBundleBase = string.Empty;
    InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base layoutModel = (InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base)Model;
    string JQueryUITheme = InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.JQueryUITheme;
    bool CustomTheme = JQueryUITheme.ToLower() != "base";
    if (CustomTheme) {
        StyleBundleBase = string.Format(@"~/Content/themes/{0}", JQueryUITheme); 
    }
} 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@layoutModel._PageTitle</title>
    <link href="/Content/_LayoutTools.css")" rel="stylesheet" type="text/css" />
    <!--Bundle Manager-->
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/modernizr")
@Styles.Render("~/Content/themes/css")
@if (CustomTheme) { 
@Styles.Render(string.Format(@"{0}/css", StyleBundleBase))
}
    <!--/Bundle Manager-->

    @if (layoutModel._SpecificCSS != null)
    {
        foreach (var cssReference in layoutModel._SpecificCSS)
        { 
        <link href="@Url.Content("~/Content/" + cssReference)" rel="stylesheet" type="text/css" />
        }
    }
    @if (layoutModel._externalCss != null)
    {
        foreach (var cssReference in layoutModel._externalCss)
        { 
        <link href="@cssReference" rel="stylesheet" type="text/css" />
        }
    }
    @if (layoutModel._externalJs != null)
    {
        foreach (var jsReference in layoutModel._externalJs)
        { 
            <script src="@Url.Content(jsReference)" type="text/javascript"></script>
        }
    }
    @foreach (var jsReference in layoutModel._SpecificJS)
    { 
        <script src="@Url.Content("~/Scripts/" + jsReference)" type="text/javascript"></script>
    }
</head>
<body>
    <input type="hidden" id="hidLanguage" value="@layoutModel._Languages.SelectedLanguage.Language" />
    <div class="">
        <div id="divBody">
            @RenderBody()
        </div>
    </div>
    <div id="dialogMessage">
    </div>
</body>
@if (layoutModel._SpecificJqueryJS != null)
{
    foreach (var specificJqueryJSReference in layoutModel._SpecificJqueryJS)
    {
        string prefix = string.Empty;
        if (!specificJqueryJSReference.StartsWith("http"))
        {
            prefix = "~/Scripts/";
        }
    <script src="@Url.Content(prefix + specificJqueryJSReference)" type="text/javascript"></script>
    }
}
@if (layoutModel._DynamicJqueryJS != null)
{
    foreach (var dynamicJqueryJS in layoutModel._DynamicJqueryJS)
    { 
    <script src="@Url.Content("~" + dynamicJqueryJS)" type="text/javascript"></script>
    }
}
@Html.Raw(@"<script type=""text/javascript"">")
@{
    foreach (string variable in layoutModel._JSVariables)
    {
	@Html.Raw(variable);
    }
}
@Html.Raw(@"$(document).ready(function () {")
@Html.Raw(@"	$.fn.DocReady();")
@Html.Raw(@"});")
@Html.Raw(@"</script>")
</html>
